<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>政工信息修改</title>
    <link th:href="@{/layui/css/layui.css}" rel="stylesheet" />
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="http://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
<!--    <script src="http://cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>-->
    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

    <style type="text/css">
        .body_box{
            width: 1500px;
            height: 1000px;
            margin: 0 auto;
        }
        .form-group{
            float: left;
            margin-right:30px ;
            width: 220px;
        }
        .modal-backdrop{z-index:0;}
        body.modal-open {
            position: absolute !important;
        }
        .table-bordered > tbody > tr > td
        {
            border: white 0px solid;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- header -->
    <div th:replace="~{commons/header::header}"></div>
    <!-- left -->
    <div th:replace="~{commons/left::left}"></div>
    <!-- 内容主体区域 -->
    <div class="layui-body">
        <div class="table-responsive">
            <table class="table text-nowrap table-bordered">
            <form action="/staff_update" method="post" th:object="${staff}">
                <h2>政工信息</h2>
                <hr>
                <h3 style="float: left;">基本信息</h3>
                <button type="submit" class="layui-btn layui-btn-normal" style="position: absolute;right: 0px;">修改资料</button>
                <input type="hidden" name="userState" th:value="${staff.getUserState()}">

                <div class="table-responsive">
                    <table class="table table-bordered">
                        <thead>

                        </thead>
                        <tbody>
                        <tr>
                            <td>姓名:</td><td><input type="text" name="staName" class="form-control" th:value="${staff.getStaName()}" required></td>
                            <td>职工号:</td><td><input type="text" name="staNum" class="form-control" th:value="${staff.getStaNum()}" readonly="readonly"></td>
                            <td>email:</td><td><input type="email" name="staEmail" class="form-control" th:value="${staff.getStaEmail()}"></td>
                        </tr>
                        <tr>
                            <td>性别:</td>
                                <td>
                                    <select name="staSex" class="form-control">&ndash;&gt;-->
                                        <option value="0" th:selected="${staff.isStaSex()}">女</option>
                                        <option value="1" th:selected="${staff.isStaSex()}">男</option>
                                    </select>
                                </td>
                            <td>民族:</td>
                            <td>
                                <select name="staNation" class="form-control">&ndash;&gt;-->
                                    <option value="0" th:selected="${staff.isStaNation()}">其他</option>
                                    <option value="1" th:selected="${staff.isStaNation()}">汉族</option>
                                </select>
                            </td>
                            <td>籍贯:</td><td><input type="text" name="staProvince" class="form-control" th:value="${staff.getStaProvince()}" required></td>
                        </tr>
                        <tr>
                            <td>政治面貌:</td>
                            <td>
                                <select name="staPoliticalOutlook" class="form-control">&ndash;&gt;-->
                                    <option value="中共团员" th:selected="${staff.getStaPoliticalOutlook()=='中共团员'}">中共团员</option>
                                    <option value="中国党员" th:selected="${staff.getStaPoliticalOutlook()=='中国党员'}">中国党员</option>
                                    <option value="其他" th:selected="${staff.getStaPoliticalOutlook()=='其他'}">其他</option>
                                </select>
                            </td>
                            <td>所在院系:</td>
                                <td>
                                    <select name="staCollege" class="form-control">&ndash;&gt;-->
                                        <option value="人工智能学院" th:selected="${staff.getStaCollege()=='人工智能学院'}">人工智能学院</option>
                                        <option value="土木工程学院" th:selected="${staff.getStaCollege()=='土木工程学院'}">土木工程学院</option>
                                    </select>
                                </td>
                            <td>学历:</td>
                                <td>
                                    <select name="staEducationBackground" class="form-control">&ndash;&gt;-->
                                        <option value="本科生" th:selected="${staff.getStaEducationBackground()=='本科生'}">本科生</option>
                                        <option value="专科生" th:selected="${staff.getStaEducationBackground()=='专科生'}">专科生</option>
                                        <option value="研究生" th:selected="${staff.getStaEducationBackground()=='研究生'}">研究生</option>
                                        <option value="博士" th:selected="${staff.getStaEducationBackground()=='博士'}">博士</option>
                                    </select>
                                </td>
                        </tr>
                        <tr>
                            <td>身份证:</td><td><input type="number" name="staIdCard" class="form-control" th:value="${staff.getStaIdCard()}" readonly="readonly"> </td>
                            <td>聘任类别:</td>
                                <td>
                                    <select name="staSort" class="form-control">&ndash;&gt;-->
                                        <option value="专职" th:selected="${staff.getStaSort()=='专职'}">专职</option>
                                        <option value="兼职" th:selected="${staff.getStaSort()=='兼职'}">兼职</option>
                                    </select>
                                </td>
                            <td>学位:</td>
                                <td>
                                    <select name="staDegree" class="form-control">&ndash;&gt;-->
                                        <option value="学士" th:selected="${staff.getStaDegree()=='学士'}">学士</option>
                                        <option value="硕士" th:selected="${staff.getStaDegree()=='硕士'}">硕士</option>
                                        <option value="博士" th:selected="${staff.getStaDegree()=='博士'}">博士</option>
                                    </select>
                                </td>
                        </tr>
                        <tr>
                            <td>出生日期:</td><td><input type="date" name="staBirthday" class="form-control"  th:value="${staff.getStaBirthday()}" required></td>
                            <td>职务:</td><td><input type="text" name="staWorkType" class="form-control" th:value="${staff.getStaWorkType()}"></td>
                            <td>婚姻:</td>
                            <td>
                                <select name="staMarriage" class="form-control">&ndash;&gt;-->
                                    <option value="1" th:selected="${staff.isStaMarriage()}">已婚</option>
                                    <option value="0" th:selected="${staff.isStaMarriage()}">未婚</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>参加工作时间:</td><td><input type="date" name="staFirstWorkDate" class="form-control" th:value="${staff.getStaFirstWorkDate()}" required></td>
                            <td>职称:</td><td><input type="text" name="staWorkTitle" class="form-control" th:value="${staff.getStaWorkTitle()}"></td>
                            <td>手机号码:</td><td><input type="number" name="staPhoneNum" class="form-control" th:value="${staff.getStaPhoneNum()}"></td>
                        </tr>
                        <tr>
                            <td>邮政编码:</td><td><input type="number"name="staPostalCode" class="form-control" th:value="${staff.getStaPostalCode()}"></td>
                            <td>在职状态:</td>
                            <td>
                                <select name="staWorkState" class="form-control">&ndash;&gt;-->
                                    <option value="1" th:selected="${staff.isStaWorkState()}">在职</option>
                                    <option value="0" th:selected="${staff.isStaWorkState()}">离职</option>
                                </select>
                            </td>
                            <td>担任辅导员（年）:</td><td><input type="text" name="staCounsellorTime" class="form-control" th:value="${staff.getStaCounsellorTime()}"></td>
                        </tr>
                        <tr>
                            <td>微信:</td><td><input type="text" name="staWechat" class="form-control" th:value="${staff.getStaWechat()}"></td>
                            <td>qq:</td><td><input type="number" name="staQqNum" class="form-control" th:value="${staff.getStaQqNum()}"></td>
                            <td></td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </form>
            <br><br><br>
            <h3>带学生情况</h3>
            <table class="table table-striped  table-bordered" >
                <tr>
                    <td>序号</td>
                    <td>年级</td>
                    <td>专业</td>
                    <td>班级</td>
                    <td>人数</td>
                    <td>操作</td>
                </tr>
                <tr  th:each="staffTakeStudent:${staffTakeStudentList}">
                    <form th:action="@{/take_student_update}" method="post" th:object="${staffTakeStudent}">
                        <td th:text="${staffTakeStudent.getTstuId()}"></td>
                        <td>
                            <select name="tstuGrade" class="">
                                <option value="20级" th:selected="${staffTakeStudent.getTstuGrade()=='20级'}">20级</option>
                                <option value="19级" th:selected="${staffTakeStudent.getTstuGrade()=='19级'}">19级</option>
                                <option value="18级" th:selected="${staffTakeStudent.getTstuGrade()=='18级'}">18级</option>
                                <option value="17级" th:selected="${staffTakeStudent.getTstuGrade()=='17级'}">17级</option>
                            </select>
                        </td>
                        <td>
                            <select name="tstuMajor" class="">
                                <option value="软件工程" th:selected="${staffTakeStudent.getTstuMajor()=='软件工程'}">软件工程</option>
                                <option value="网络工程" th:selected="${staffTakeStudent.getTstuMajor()=='网络工程'}">网络工程</option>
                                <option value="计算机科学与技术" th:selected="${staffTakeStudent.getTstuMajor()=='计算机科学与技术'}">计算机科学与技术</option>
                                <option value="大数据技术" th:selected="${staffTakeStudent.getTstuMajor()=='大数据技术'}">大数据技术</option>
                            </select>
                        </td>
                        <td>
                            <select name="tstuClass" class="">
                                <option value="一班" th:selected="${staffTakeStudent.getTstuClass()=='一班'}">一班</option>
                                <option value="二班" th:selected="${staffTakeStudent.getTstuClass()=='二班'}">二班</option>
                            </select>
                        </td>
                        <td><input type="number" name="tstuStistic" th:value="${staffTakeStudent.getTstuStistic()}" required></td>
                        <input type="hidden" name="tstuId" th:value="${staffTakeStudent.getTstuId()}">
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                        <td>
                            <button class="layui-btn layui-btn-normal layui-btn-radius" type="submit">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">
                                <a style="color: white;" th:href="@{'/take_student_delete/'+${staffTakeStudent.getTstuId()}+'/'+${staff.getStaNum()}}" onClick="return confirm('确定删除?');">删除</a>
                            </button>
                        </td>
                    </form>
                </tr>
                <tr>
                    <form th:action="@{/take_student_add}" method="post" th:object="${staffTakeStudent}">
                        <td><i class="layui-icon layui-icon-add-1"></i></td>
                        <td>
                            <select name="tstuGrade" class="" required>
                                <option value="" >请选择</option>
                                <option value="20级" >20级</option>
                                <option value="19级" >19级</option>
                                <option value="18级" >18级</option>
                                <option value="17级" >17级</option>
                            </select>
                        </td>
                        <td>
                            <select name="tstuMajor" class="" required>
                                <option value="" >请选择</option>
                                <option value="软件工程">软件工程</option>
                                <option value="网络工程" >网络工程</option>
                                <option value="计算机科学与技术">计算机科学与技术</option>
                                <option value="大数据技术" >大数据技术</option>
                            </select>
                        </td>
                        <td>
                            <select name="tstuClass" class="" required>
                                <option value="" >请选择</option>
                                <option value="一班" >一班</option>
                                <option value="二班" >二班</option>
                            </select>
                        </td>
                        <td><input type="number" name="tstuStistic" required></td>
                        <td><button class="layui-btn layui-btn-radius" type="submit">新增</button></td>
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                    </form>
                </tr>
            </table>

            <h3>奖励情况</h3>
            <table class="table table-striped  table-bordered" >
                <tr>
                    <td>序号</td>
                    <td>奖励名称</td>
                    <td>奖励时间</td>
                    <td>授予单位</td>
                    <td>操作</td>
                </tr>
                <tr  th:each="staffReward:${staffRewardList}">
                    <form th:action="@{/reward_update}" method="post" th:object="${staffReward}">
                        <td th:text="${staffReward.getRewardId()}"></td>
                        <td><input type="text" name="rewardName" th:value="${staffReward.getRewardName()}" required></td>
                        <td><input type="date" name="rewardTime" th:value="${staffReward.getRewardTime()}" required></td>
                        <td>
                            <select name="rewardUnit" class="">
                                <option value="国家级" th:selected="${staffReward.getRewardUnit()=='国家级'}">国家级</option>
                                <option value="省级" th:selected="${staffReward.getRewardUnit()=='省级'}">省级</option>
                                <option value="市级" th:selected="${staffReward.getRewardUnit()=='市级'}">市级</option>
                                <option value="县级" th:selected="${staffReward.getRewardUnit()=='县级'}">县级</option>
                                <option value="校级" th:selected="${staffReward.getRewardUnit()=='校级'}">校级</option>
                            </select>
                        </td>
                        <input type="hidden" name="rewardId" th:value="${staffReward.getRewardId()}">
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                        <td>
                            <button class="layui-btn layui-btn-normal layui-btn-radius" type="submit">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">
                            <a style="color: white;"  th:href="@{'/reward_delete/'+${staffReward.getRewardId()}+'/'+${staff.getStaNum()}}" onClick="return confirm('确定删除?');">删除</a>
                            </button>
                        </td>
                    </form>
                </tr>
                <tr>
                    <form th:action="@{/reward_add}" method="post" th:object="${staffReward}">
                        <td><i class="layui-icon layui-icon-add-1"></i></td>
                        <td><input type="text" name="rewardName" required></td>
                        <td><input type="date" name="rewardTime" required></td>
                        <td>
                            <select name="rewardUnit" class="" required>
                                <option value="国家级" >国家级</option>
                                <option value="省级" >省级</option>
                                <option value="市级" >市级</option>
                                <option value="县级" >县级</option>
                                <option value="校级" >校级</option>
                            </select>
                        </td>
                        <td><button class="layui-btn layui-btn-radius" type="submit">新增</button></td>
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                    </form>
                </tr>
            </table>

            <h3>职业培训</h3>
            <table class="table table-striped  table-bordered" >
                <tr>
                    <td>序号</td>
                    <td>培训名称</td>
                    <td>培训单位</td>
                    <td>培训时间</td>
                    <td>操作</td>
                </tr>
                <tr  th:each="staffTrain:${staffTrainList}">
                    <form th:action="@{/train_update}" method="post" th:object="${staffTrain}">
                        <td th:text="${staffTrain.getTrainId()}"></td>
                        <td><input type="text" name="trainName" th:value="${staffTrain.getTrainName()}" required></td>
                        <td><input type="text" name="trainUnit" th:value="${staffTrain.getTrainUnit()}" required></td>
                        <td><input type="date" name="trainTime" th:value="${staffTrain.getTrainTime()}" required></td>
                        <input type="hidden" name="trainId" th:value="${staffTrain.getTrainId()}">
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                        <td>
                            <button class="layui-btn layui-btn-normal layui-btn-radius" type="submit">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">
                            <a style="color: white;"  th:href="@{'/train_delete/'+${staffTrain.getTrainId()}+'/'+${staff.getStaNum()}}" onClick="return confirm('确定删除?');">删除</a>
                            </button>
                        </td>
                    </form>
                </tr>
                <tr>
                    <form th:action="@{/train_add}" method="post" th:object="${staffTrain}">
                        <td><i class="layui-icon layui-icon-add-1"></i></td>
                        <td><input type="text" name="trainName" required></td>
                        <td><input type="text" name="trainUnit" required></td>
                        <td><input type="date" name="trainTime" required></td>
                        <td><button class="layui-btn layui-btn-radius" type="submit">新增</button></td>
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                    </form>
                </tr>
            </table>

            <h3>职业资格证书</h3>
            <table class="table table-striped  table-bordered" >
                <tr >
                    <td>序号</td>
                    <td>证书名称</td>
                    <td>授予单位</td>
                    <td>获取时间</td>
                    <td>操作</td>
                </tr>
                <tr th:each="staffCertificate:${staffCertificateList}">
                    <form th:action="@{/cert_update}" method="post" th:object="${staffCertificate}">
                        <td th:text="${staffCertificate.getCertId()}"></td>
                        <td><input type="text" name="certName" th:value="${staffCertificate.getCertName()}" required></td>
                        <td>
                            <input type="text" name="certUnit" th:value="${staffCertificate.getCertUnit()}" required>
                        </td>
                        <td><input type="date" name="certTime" th:value="${staffCertificate.getCertTime()}" required></td>
                        <input type="hidden" name="certId" th:value="${staffCertificate.getCertId()}">
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                        <td>
                            <button class="layui-btn layui-btn-normal layui-btn-radius" type="submit">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">
                            <a style="color: white;"  th:href="@{'/certificate_delete/'+${staffCertificate.getCertId()}+'/'+${staff.getStaNum()}}" onClick="return confirm('确定删除?');">删除</a>
                            </button>
                        </td>
                    </form>
                </tr>
                <tr>
                    <form th:action="@{/cert_add}" method="post" th:object="${staffCertificate}">
                        <td><i class="layui-icon layui-icon-add-1"></i></td>
                        <td><input type="text" name="certName" required></td>
                        <td><input type="text" name="certUnit" required></td>
                        <td><input type="date" name="certTime" required></td>
                        <td><button class="layui-btn layui-btn-radius" type="submit">新增</button></td>
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                    </form>
                </tr>
            </table>

            <h3>论文发表情况</h3>
            <table class="table table-striped  table-bordered" >
                <tr>
                    <td>序号</td>
                    <td>论文名称</td>
                    <td>发表刊物</td>
                    <td>发表时间</td>
                    <td>操作</td>
                </tr>
                <tr th:each="staffThesis:${StaffThesisList}" >
                    <form th:action="@{/thesis_update}" method="post" th:object="${staffThesis}">
                        <td th:text="${staffThesis.getThesisId()}"></td>
                        <td><input type="text" name="thesisName" th:value="${staffThesis.getThesisName()}" required></td>
                        <td><input type="text" name="thesisForPublication" th:value="${staffThesis.getThesisForPublication()}" required></td>
                        <td><input type="date" name="thesisTime" th:value="${staffThesis.getThesisTime()}" required></td>
                        <input type="hidden" name="thesisId" th:value="${staffThesis.getThesisId()}">
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                        <td>
                            <button class="layui-btn layui-btn-normal layui-btn-radius" type="submit">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">
                            <a style="color: white;"  th:href="@{'/thesis_delete/'+${staffThesis.getThesisId()}+'/'+${staff.getStaNum()}}" onClick="return confirm('确定删除?');">删除</a>
                            </button>
                        </td>
                    </form>
                </tr>
                <tr>
                    <form th:action="@{/thesis_add}" method="post" th:object="${staffThesis}">
                        <td><i class="layui-icon layui-icon-add-1"></i></td>
                        <td><input type="text" name="thesisName" required></td>
                        <td><input type="text" name="thesisForPublication" required></td>
                        <td><input type="date" name="thesisTime" required></td>
                        <td><button class="layui-btn layui-btn-radius" type="submit">新增</button></td>
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                    </form>
                </tr>
            </table>

            <h3>教学情况</h3>
            <table class="table table-striped  table-bordered" >
                <tr>
                    <td>序号</td>
                    <td>课程名称</td>
                    <td>起始时间</td>
                    <td>结束时间</td>
                    <td>操作</td>
                </tr>
                <tr th:each="staffCourse:${staffCourseList}">
                    <form th:action="@{/course_update}" method="post" th:object="${staffCourse}">
                        <td th:text="${staffCourse.getCourseId()}"></td>
                        <td><input type="text" name="courseName" th:value="${staffCourse.getCourseName()}" required></td>
                        <td><input type="date" name="courseBegin" th:value="${staffCourse.getCourseBegin()}" required></td>
                        <td><input type="date" name="courseEnd" th:value="${staffCourse.getCourseEnd()}" required></td>
                        <input type="hidden" name="courseId" th:value="${staffCourse.getCourseId()}">
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                        <td>
                            <button class="layui-btn layui-btn-normal layui-btn-radius" type="submit">编辑</button>
                            <button type="button" class="layui-btn layui-btn-danger layui-btn-radius">
                            <a style="color: white;"  th:href="@{'/course_delete/'+${staffCourse.getCourseId()}+'/'+${staff.getStaNum()}}" onClick="return confirm('确定删除?');">删除</a>
                            </button>
                        </td>
                    </form>
                </tr>
                <tr>
                    <form name="myForm" th:action="@{/course_add}" onsubmit="return validateForm()" method="post" th:object="${staffCourse}">
                        <td><i class="layui-icon layui-icon-add-1"></i></td>
                        <td><input type="text" name="courseName" required></td>
                        <td><input type="date" name="courseBegin" required></td>
                        <td><input type="date" name="courseEnd" required></td>
                        <td><button class="layui-btn layui-btn-radius" type="submit">新增</button></td>
                        <input type="hidden" name="staNum" th:value="${staff.getStaNum()}">
                    </form>
                </tr>
            </table>

            </table>
        </div>
    </div>
</div>
<script th:src="@{/layui/layui.js}"></script>


<script>
    //JavaScript代码区域
    layui.use('layer', function(){
        var layer = layui.layer;
    });
    function validateForm()
    {
        var x=document.forms["myForm"]["courseBegin"].value;
        var y=document.forms["myForm"]["courseEnd"].value;
        console.log(x,y)
        if(!x<y){
            alert("结束时间必须大于开始时间");
            return false;
        }
    }

</script>
</body>
</html>